<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.sinodata.bsm.common.vo.Probe"%>
<%@ include file="../include/taglib.jsp"%>
<%
    response.setHeader("Cache-Control", "no-store");
    response.setHeader("Pragrma", "no-cache");
    response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>BSM页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<%@ include file="../include/common.jsp"%>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/sub_menu.css" />

<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/selfmainten/probe.css" />
	
<script type=text/javascript>


	
	function getBaseInfo(){
		$.ajax({
			url : 'bsm!getBaseInfo.action', 
			type : 'POST',
			dataType : "json",
			data : {
				
			},
			success : function(data) {
				$('#resCnt').text(data.res);
				$('#jdkVersion').text(data.jdkVer);
				$('#startTime').text(data.stime);
				$('#jvmMax').text(data.max);
				$('#jvmTotal').text(data.total);
				$('#jvmFree').text(data.free);
				$('#jvmUae').text(data.usable);
				$('#jdkhome').text(data.javahome);
				$('#javavendor').text(data.javavendor);
				$('#osname').text(data.osname);
				$('#osversion').text(data.osversion);
				$('#username').text(data.username);
				
				if(data.usable/data.max > 0.1){
					$('#jvmUae').next().append('<p><h3><font color=#0000ff>有足够可用内存</font></h3></p>');
				}else{
					$('#jvmUae').next().append('<p><h3><font color=#ff0000>可用内存较小 建议增大内存配置</font></h3></p>');
				}
				
				if(/^1.6.*/.exec(data.jdkVer)!=null){
					$('#jdkVersion').next().append('<p><h3><font color=#0000ff>JDK版本合适</font></h3></p>');
				}else{
					if((/^1.5\.*/.exec(data.jdkVer)!=null) || (/^1.4\.*/.exec(data.jdkVer)!=null)){
						$('#jdkVersion').next().append('<p><h3><font color=#ff0000>JDK版本太小</font></h3></p>');
					}else{
						$('#jdkVersion').next().append('<p><h3><font color=#ff0000>JDK版本不合适</font></h3></p>');
					}
				}
			}
		});
	}
	
	
	
	//
	function getBSMInfo(){
		$.ajax({
			url : 'bsm!getBSMInfo.action', 
			type : 'POST',
			dataType : "json",
			data : {
				
			},
			success : function(data) {
				$('#mq').text(data.mq);
				$('#uam').text(data.uam);
			}
		});
	}
	
	
	function back(){
		var backUrl = document.referrer;
		location.assign(backUrl);
	}

    $(function() {
    	getBaseInfo();
    	getBSMInfo();
    });

</script>

</head>
<body>

	<div style="width:80%;float:left;">
		<fieldset class="column b-1" style="margin-top:10px;">
			<legend>虚拟机参数</legend>
			<div class="col-net-main" style="height:auto;">
				<div style="float:left;width:98%;">
					<ul class="col-l-ul">
						  <li><span class="col-l-ul-l" >JDK运行时环境版本：</span><span
								id="jdkVersion" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					      <li><span class="col-l-ul-l" >JVM最大内存约(MB)：</span><span
								id="jvmMax" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					      <li><span class="col-l-ul-l" >JVM已分配内存约(MB)：</span><span
								id="jvmTotal" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					      <li><span class="col-l-ul-l" >JVM已分配内存中的剩余空间约(MB)：</span><span
								id="jvmFree" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					      <li><span class="col-l-ul-l" >JVM最大可用内存约(MB)：</span><span
								id="jvmUae" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
						  <li><span class="col-l-ul-l" >JDK安装目录：</span><span
								id="jdkhome" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					      <li><span class="col-l-ul-l" >JDK运行时环境供应商：</span><span
								id="javavendor" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					      <li><span class="col-l-ul-l" >操作系统名称：</span><span
								id="osname" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					      <li><span class="col-l-ul-l" >操作系统的版本：</span><span
								id="osversion" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					      <li><span class="col-l-ul-l" >用户的账户名称：</span><span
								id="username" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
					</ul>
				</div>
			</div>
		</fieldset>
		<fieldset class="column b-1">
			<legend>BSM配置参数</legend>
			<div class="col-net-main" style="height:auto;">
				<div id="perfAna" style="float:left;width:98%;text-align:right;">
				   <ul class="col-l-ul">
					      <li><span class="col-l-ul-l" >ActiveMQ地址：</span><span
								id="mq" class="col-l-ul-mid"></span>
								<span class="col-l-ul-right"></span>
						  </li>
						  <li><span class="col-l-ul-l" >UAM地址：</span><span
								id="uam" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
						  <!--  
						  <li><span class="col-l-ul-l" >通知中心是否可用：</span><span
								id="notify" class="col-l-ul-mid" ></span>
								<span class="col-l-ul-right"></span>
						  </li>
						  -->
				   </ul>
				</div>
			</div>
		</fieldset>
   </div>
</body>
</html>